sonObj=function()
{
	this.x;
	this.y;
	this.angle;
	this.smallBody=new Image();
	this.smallTail=new Image();
	
	this.babyTailTimer=0;
	this.tailCount=0;
	
	this.babyEyeTimer=0;
	this.eyeCount=0;
	this.internal=1000;
	
	this.babyBodyTimer=0;
	this.bodyCount=0;
}

sonObj.prototype.init=function()
{
	this.x=canWidth*0.5;
	this.y=canHeight*0.5;
	this.angle=0;
	this.smallBody.src="./src/baby.png";
	this.smallTail.src="./src/babyTail0.png";
}

sonObj.prototype.draw=function()
{
	//lerp x,y
	this.x=lerpDistance(mom.x,this.x,0.99);
	this.y=lerpDistance(mom.y,this.y,0.99);
	
	//delta angle
	//Math.atan2(y,x)
	var deltaY=mom.y-this.y;
	var deltaX=mom.x-this.x;
	var beta=Math.atan2(deltaY,deltaX)+Math.PI;
	
	//lerp angle
	this.angle=lerpAngle(beta,this.angle,0.88);
	
	this.babyTailTimer+=deltaTime;
	if(this.babyTailTimer>80)
	{
		this.tailCount=(this.tailCount+1)%8;
		this.babyTailTimer%=80;
	}
	
	this.babyEyeTimer+=deltaTime;
	if(this.babyEyeTimer>this.internal)
	{
		this.eyeCount=(this.eyeCount+1)%2;
		this.babyEyeTimer%=this.internal;
		
		if(this.eyeCount==0)
		{
			this.internal=Math.random()*1500+2000;
		}
		else
		{
			this.internal=Math.random()*200+100;
		}
	}
	
	this.babyBodyTimer+=deltaTime;
	if(this.babyBodyTimer>300)
	{
		this.bodyCount++;
		this.babyBodyTimer%=300;
		if(this.bodyCount>19)
		{
			this.bodyCount=19;
			//game over!
			data.gameOver=true;
		}
	}
	
	ctx1.save();
	ctx1.translate(this.x,this.y);
	ctx1.rotate(this.angle);
	ctx1.drawImage(this.smallTail,25-this.tailCount-this.smallTail.width*0.5,-this.smallTail.height*0.5);
	ctx1.drawImage(babyBodys[this.bodyCount],-babyBodys[this.bodyCount].width*0.5,-babyBodys[this.bodyCount].height*0.5);
	ctx1.drawImage(babyEyes[this.eyeCount],-babyEyes[this.eyeCount].width*0.5,-babyEyes[this.eyeCount].height*0.5);
	
	ctx1.restore();
}